<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>内容管理系统</title>
    <style>
        /* 页面加载动画 */
        
        #loading {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            transition: opacity 0.5s ease;
        }
        
        #loading.hide {
            opacity: 0;
            pointer-events: none;
        }
        
        .spinner {
            width: 50px;
            height: 50px;
            border: 4px solid rgba(255, 255, 255, 0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }
        
        .loading-text {
            color: white;
            margin-top: 20px;
            font-size: 16px;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
        
        .loading-tip {
            color: rgba(255, 255, 255, 0.8);
            margin-top: 10px;
            font-size: 14px;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
    </style>
</head>

<body>
    <!-- 加载动画 -->
    <div id="loading">
        <div class="spinner"></div>
        <div class="loading-text">正在加载...</div>
    </div>

    <div id="app"></div>

    <script type="module" src="/src/main.js"></script>

    <script>
        // 5秒后如果还在加载，隐藏加载动画并显示提示
        setTimeout(() => {
            const loading = document.getElementById('loading');
            if (loading) {
                loading.classList.add('hide');
                setTimeout(() => {
                    loading.style.display = 'none';
                }, 500);
            }
        }, 5000);

        // 当 Vue 应用挂载后，隐藏加载动画
        window.addEventListener('DOMContentLoaded', () => {
            setTimeout(() => {
                const loading = document.getElementById('loading');
                if (loading && document.getElementById('app').children.length > 0) {
                    loading.classList.add('hide');
                    setTimeout(() => {
                        loading.style.display = 'none';
                    }, 500);
                }
            }, 1000);
        });
    </script>
</body>

</html>